﻿@{
    ViewBag.Title = "详细管理";
    Layout = "~/Views/Shared/_AdminLayOut.cshtml";
}
@model List<UcAsp.Net.Model.SetFiled>
<div class="container-fluid">
		<div class="row-fluid">
        <div class="span12">
			<div class="widget-box">
				<div class="widget-title">
					<span class="icon">
						<i class="icon-th"></i>
					</span>
					<h5>项目列表</h5>
				</div>
				<div class="widget-content nopadding">
                <table class="table table-bordered table-striped">
					<thead>
						<tr>
							<th>字段</th>
							<th>名称</th>
							<th>数据类型</th>
							<th>排序</th>
                            <th>操作</th>
						</tr>

					</thead>
                    <tbody>
                    @foreach(UcAsp.Net.Model.SetFiled f in Model)
                    {
					    <tr>
						    <td>@f.FiledName</td>
						    <td>@f.CnName</td>
						    <td>@f.InputType</td>
						    <td>@f.Rank</td>
                            <td>
                                <div class="btn-group"><div class="btn btn-primary modify" data-id="@f.FiledID" data-cid="@f.CategoreiesID">修改</div>
                                    <div class="btn btn-danger delete" data-id="@f.FiledID" data-cid="@f.CategoreiesID">删除</div>
                                <div class="btn btn-primary up"  data-id="@f.FiledID" title="提高"><span class="icon-white"><i class="icon-white icon-arrow-up"></i></span></div>
                                <div class="btn btn-primary down" data-id="@f.FiledID" title="下降"><span class="icon-white"><i class="icon-white icon-arrow-down"></i></span></div>
                                    </div>
                            </td>
					    </tr>
                    }
                    </tbody>
                </table>
                </div>
            </div>
        </div>
        </div>
</div>
<script>
    ///设置项目
    $(".modify").click(function () {
        $.get("/Admin/EditSetFiled?CID=" + $(this).attr("data-cid") + "&ID=" + $(this).attr("data-id"), function (dataResult) {
            $.facebox(dataResult, "ucaspfacebox");
        });
    })
    $(".delete").click(function () {
        $.post("/Admin/DeleteSetFiled", { ID:$(this).attr("data-id") }, function (dataBack) {
            if (dataBack.Result == true) {
                location.reload();
            }
        });
    })
    $(".up").click(function () {
        $.post("/Admin/UpdateSetFiledRank", { ID:$(this).attr("data-id"),action:"up" }, function (dataBack) {
            if (dataBack.Result == true) {
                location.reload();
            }
        });
    })
    $(".down").click(function () {
        $.post("/Admin/UpdateSetFiledRank", { ID: $(this).attr("data-id"), action: "down" }, function (dataBack) {
            if (dataBack.Result == true) {
                location.reload();
            }
        });
    })
</script>